app.controller('information',function($scope,$http,$ionicLoading){
	$ionicLoading.show()
	$http.get('/api/v2/articles',{
		params:{
			"type":"news",
			"offset":0,
			"limit":16
		}
	}).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		console.log(res.data)
		$scope.information=res.data
		$scope.shows()
		$scope.loadMore=function(){
			$scope.shows()
		}
		$scope.loads=function(){
			$scope.loadMore()
		}
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	$scope.shows=function(){
		$http.get('/api/v2/articles',{
		params:{
			"type":"news",
			"offset":$scope.information.length+16,
			"limit":16
		}
	}).then(function(res){
		if(res){
			$ionicLoading.hide()
		}
		console.log(res.data)
		$scope.information=$scope.information.concat(res.data)
		
	}).catch(function(err){
		$ionicLoading.show({
			duration:3000,
			template:'获取失败'
		})
	})
	}
})
